package hotsaucerecipes

class Recipe {
    String title
    //dateCreated is auto-gen
    Date dateCreated
    String instructions
    String ingredients

    static hasMany = [reviews: Review]

    static searchable = true

    static constraints = {
        title(blank: false, maxSize: 100)
        ingredients(blank: false)
        instructions(blank: false, widget: 'textarea')
        dateCreated()
    }

    static mapping = {
        sort "dateCreated"
        instructions type: "text"
        ingredients type: "text"
    }

    String toString() {
        return "${title}"
    }
    //Comment
}
